home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_79 / recd.c < prev    next >
C/C++ Source or Header  |  1995-01-01  |  2KB  |  81 lines

  1. /*-------------------------------------------------------*/
  2. /* Originally part of SOUNDHAX v1 by John M. Trindle     */
  3. /*                 FREEWARE 12/19/91                     */
  4. /*-------------------------------------------------------*/
  5.  
  6. #include <stdio.h>
  7.  
  8.  
  9. #define  CMS_AVAILABLE  1
  10. #define  FM_AVAILABLE   2
  11. #define  CV_AVAILABLE   4
  12.  
  13. #define  OFF            0
  14. #define  ON             1
  15.  
  16. #define  FALSE          0
  17. #define  TRUE           1
  18.  
  19. extern _ct_io_addx;
  20. extern _ct_int_num;
  21. extern _ct_music_status;
  22. extern _ct_voice_status;
  23.  
  24. static int StatusWord;
  25.  
  26. char *VoiceDriver;
  27.  
  28.  
  29. main(int argc, char *argv[])
  30. {
  31.    int DriverFeatures,VersionCode,RetVal,i;
  32.  
  33.    char buffer[255];
  34.    FILE *fp;
  35.  
  36.  
  37.    _ct_io_addx = 0x220;    /* I/O Base */
  38.  
  39.    DriverFeatures = _ct_card_here();
  40.  
  41.    if (DriverFeatures & CMS_AVAILABLE)
  42.       printf("C/MS Music Available\n");
  43.  
  44.    if (DriverFeatures & FM_AVAILABLE)
  45.       printf("FM Music Available\n");
  46.  
  47.    if (DriverFeatures & CV_AVAILABLE)
  48.       printf("Creative Voice Available\n");
  49.    else
  50.    {
  51.       printf("Sound Blaster or Compatible NOT detected\n");
  52.       exit(1);
  53.    }
  54.  
  55.  
  56.    VersionCode = _sbc_version();
  57.    printf("SBV Version = %d.%d\n",VersionCode >> 8, VersionCode & 0xff);
  58.  
  59.    _sbc_scan_int();
  60.  
  61.    printf("Interrupt = %d\n",_ct_int_num);
  62.  
  63.    RetVal = _ctvd_init(6);
  64.    printf("RetVal = %d\n",RetVal);
  65.  
  66.    fp = fopen(argv[1],"wb");
  67.  
  68.    _ctvd_speaker(OFF);
  69.    _ctvd_input(fp->_file,250);
  70.    while (TRUE)
  71.    {
  72.       if (kbhit())
  73.       {
  74.          if(!getch())
  75.             getch();
  76.          break;
  77.       }
  78.    }  
  79.    _ctvd_terminate();
  80. }
  81.